import React, { Component } from 'react';
import ReactDOM from 'react-dom';
import App from './App';
import {createStore} from 'redux';
import Provider from './react-redux/index';

const store=createStore(reducer);

function reducer (state={num:0},action){
    state=JSON.parse(JSON.stringify(state));
    switch(action.type){
        case "ADD":
            state.num++;
            break;
        default:
            return state;
    }
    return state;
}




    ReactDOM.render(
        <Provider store={store}>
            <App/>
        </Provider>,
        document.getElementById('root')
    )

